# -*- coding: utf-8 -*-
from flask_wtf import  FlaskForm
from wtforms import  StringField,PasswordField
from wtforms.validators import DataRequired , length

class LoginForm(FlaskForm):
    usernum = StringField('usernum', validators=[DataRequired(message=u"账号不能为空"),length(5,20,message=u'长度位于5~20之间')],render_kw={'placeholder':u'请输入账号'})
    password = PasswordField('password', validators=[DataRequired(message=u"密码不能为空"),length(6,20,message=u'长度位于6~20之间')],render_kw={'placeholder':u'请输入密码'})

#StringField代表的是input type=text
#validators 对这个域的数据做检查
